package com.apache.poi.word.config.policy;

import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.policy.AbstractRenderPolicy;
import com.deepoove.poi.policy.RenderPolicy;
import com.deepoove.poi.render.RenderContext;
import com.deepoove.poi.template.ElementTemplate;
import org.apache.poi.xwpf.usermodel.XWPFRun;

/**
 * @Author: HUANG GY.
 * @Date: 2022/2/10 15:48
 * @Description: com.apache.poi.word.config.policy
 */
public class BreakPageNoneRenderPolicy extends AbstractRenderPolicy {

    @Override
    public void doRender(RenderContext context) throws Exception {
        // anywhere
        XWPFRun where = context.getWhere();
        // do 文本
        where.setText("", 0);
        where.getParent().getDocument().createParagraph().setPageBreak(Boolean.TRUE);
    }
}
